package shejimoshi;

public class Director {

    /**
     * 建造一部手机
     *
     * @param buildPhone
     * @return
     */
    public static IBuildPhone createMobilePhone(IBuildPhone buildPhone) {

        buildPhone.buildBattery();
        buildPhone.buildMicrophone();
        buildPhone.buildScreen();
        buildPhone.buildPhoneReceiver();
        buildPhone.buildPhoneBody();

        return buildPhone;
    }


    public static void main(String[] args) {
        final IBuildPhone mobilePhone = createMobilePhone(new IPhoneX());
        System.out.println(mobilePhone);
    }
}